package com.gxa.modules.community.controller;

import com.gxa.modules.community.entity.PropertyPhone;
import com.gxa.modules.community.service.PropertyService;
import com.gxa.modules.community.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "联系物业")
public class PropertyController {
    @Autowired
    private PropertyService propertyService;
    @ApiOperation("物业联系 查询")
    @GetMapping("/property/list")
    public Result<List<PropertyPhone>> propertyList(){
        Result<List<PropertyPhone>> r=Result.success();
        try {
            List<PropertyPhone> propertyList = this.propertyService.propertyList();
            r=Result.success(propertyList);
        }catch (Exception e){
            r.setCode("1");
            r.setMsg("error");
            e.printStackTrace();
        }
        return r;
    }

}
